from django.conf.urls.defaults import *
from notes import views

urlpatterns = patterns('',
    (r'^$', views.index),
    (r'^admin/', include('django.contrib.admin.urls')),
    (r'^u/(\w+)/$', views.user_index),
    (r'^note/(\d+)/$', views.note),
    (r'^note/create/$', views.create),
    (r'^note/(\d+)/edit/$', views.edit),
    
    (r'demo/$', 'django_openidauth.regviews.demo_delete_me_asap'),
    
    (r'^register/$', 'django_openidauth.regviews.register', {
        'success_url': '/'
    }),
    (r'^openid/login/$', 'django_openidconsumer.views.begin', {
        'sreg': 'email,nickname',
        'redirect_to': '/openid/complete/'
    }),
    (r'^openid/complete/$', 'django_openidauth.views.complete', {
        'on_login_ok_url'    : '/',
        'on_login_failed_url': '/register/'
    }),
    (r'^openid/signout/$', 'django_openidconsumer.views.signout'),
    (r'^openid/associations/$', 'django_openidauth.views.associations'),
    (r'^login/$', 'django.contrib.auth.views.login', {
        'template_name'   : 'openid_login.html'
    }),
    (r'^logout/$', views.logout_view),
)
